package com.baidu.st.fe.spllot.load;

import java.io.Reader;
import java.io.StringReader;

public class StringCodeLoader extends CodeLoader {

	public static final String DEFAULT_NAME = "CODE_LOADER_FROM_STRING";

	private String source_code;
	private String name;

	public StringCodeLoader(String code) {
		this(code, DEFAULT_NAME);

	}

	public StringCodeLoader(String code, String name) {
		this.source_code = code;
		this.name = name;
	}

	@Override
	protected Reader getReader() throws Exception {
		// TODO Auto-generated method stub
		return new StringReader(source_code);
	}

	public String getSource_code() {
		return source_code;
	}

	public void setSource_code(String source_code) {
		this.source_code = source_code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
